/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.sll.itintegration.catalogue.capacity.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author khaleddaham
 */
@SuppressWarnings("PMD.UnusedPrivateField")
@Entity
@Data
@Table(name="capacity")
@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@EqualsAndHashCode(of = {"id"})
public class CapacityEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Getter(AccessLevel.NONE)
    @Setter(AccessLevel.NONE)
    private Long id;
    @NotNull
    private String value;
    @NotNull
    private String code;
    @NotNull
    private String codeSystem;
    @ManyToOne
    private ProductReferenceEntity product;
    @NotNull
    private String createdByHsaID;
    @NotNull
    private String sourceSystemHsaID;
    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    private Date creationTime;
    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    private Date validTo;
}